@import url("icons/icons.css");
@import url("popup.css");
@import "special/windows.css";
@import "special/linux.css";
@import "special/mac.css";

@media (-moz-platform: windows),
       (-moz-platform: linux),
       (-moz-platform: macos)
{

/* ---------------------------------------- Tabs (SVG) ---------------------------------------- */

@supports -moz-bool-pref("userChrome.Tabs.Option1.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_1/left_corners.svg");
        --center-svg: url("special/tabs/option_1/center.svg");
        --right-svg:  url("special/tabs/option_1/right_corners.svg");
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option2.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_2/left_corners.svg");
        --center-svg: url("special/tabs/option_2/center.svg");
        --right-svg:  url("special/tabs/option_2/right_corners.svg");
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option3.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_3/left_corners.svg");
        --center-svg: url("special/tabs/option_3/center.svg");
        --right-svg:  url("special/tabs/option_3/right_corners.svg");
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option4.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_4/left_corners.svg");
        --center-svg: url("special/tabs/option_4/center.svg");
        --right-svg:  url("special/tabs/option_4/right_corners.svg");
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option5.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_5/left_corners.svg");
        --center-svg: url("special/tabs/option_5/center.svg");
        --right-svg:  url("special/tabs/option_5/right_corners.svg");
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option6.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_1/left_corners.svg");
        --center-svg: url("special/tabs/option_1/center.svg");
        --right-svg:  url("special/tabs/option_1/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 4);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option7.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_6/left_corners.svg");
        --center-svg: url("special/tabs/option_6/center.svg");
        --right-svg:  url("special/tabs/option_6/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 4);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option8.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_7/left_corners.svg");
        --center-svg: url("special/tabs/option_7/center.svg");
        --right-svg:  url("special/tabs/option_7/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 4);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option9.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_8/left_corners.svg");
        --center-svg: url("special/tabs/option_8/center.svg");
        --right-svg:  url("special/tabs/option_8/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 2 - 6px);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option10.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_9/left_corners.svg");
        --center-svg: url("special/tabs/option_9/center.svg");
        --right-svg:  url("special/tabs/option_9/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 2);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option11.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_10/left_corners.svg");
        --center-svg: url("special/tabs/option_10/center.svg");
        --right-svg:  url("special/tabs/option_10/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 2);
    }
}

@supports -moz-bool-pref("userChrome.Tabs.Option12.Enabled")
{
    :root
    {
        --left-svg:   url("special/tabs/option_11/left_corners.svg");
        --center-svg: url("special/tabs/option_11/center.svg");
        --right-svg:  url("special/tabs/option_11/right_corners.svg");

        --tab-first-last-inline-margin: calc(var(--tab-min-height) / 2);
    }
}

/* -------------------- Floating Tabs -------------------- */

@supports -moz-bool-pref("userChrome.Tabs.Option1.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option2.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option3.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option4.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option5.Enabled")
{
    :root
    {
        --tab-first-last-inline-margin: calc(var(--tab-block-margin) / 2);
        --tab-overflow-clip-margin: var(--tab-first-last-inline-margin);
        --tab-inset-clip-path: 0px calc(-1 * var(--tab-first-last-inline-margin));
        --tab-scroll-animation-inline-margin: calc(-1 * var(--tab-first-last-inline-margin));
        --tab-scroll-animation-inline-padding: calc(var(--tab-first-last-inline-margin) * 2);
        --tab-bg-block-margin: var(--tab-block-margin);
        --tab-inline-padding: var(--tab-first-last-inline-margin);
        --tab-separator-offset: var(--tab-first-last-inline-margin);
        --tab-attention-indicator-position: center bottom calc(((var(--tab-min-height) - 16px) / 2 - 4px) / 2 + var(--tab-block-margin));
    }


}

/* -------------------- Attached Tabs -------------------- */

@supports -moz-bool-pref("userChrome.Tabs.Option6.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option7.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option8.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option9.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option10.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option11.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option12.Enabled")
{
    :root
    {
        --tab-overflow-clip-margin: var(--tab-first-last-inline-margin);
        --tab-inset-clip-path: -4px calc(-1 * var(--tab-first-last-inline-margin)) 0px;
        --tab-scroll-animation-inline-margin: calc(-1 * var(--tab-first-last-inline-margin));
        --tab-scroll-animation-inline-padding: var(--tab-first-last-inline-margin);
        --tab-bg-block-margin: 0px;
        --tab-inline-padding: 0px;
        --tab-separator-offset: 0px;
        --tab-attention-indicator-position: center bottom calc(((var(--tab-min-height) - 16px) / 2 - 4px) / 2);
    }
}

/* ---------------------------------------- Tab Frame ---------------------------------------- */

@supports (
          (
           -moz-bool-pref("userChrome.LightTheme.TabFrameType.Border.Enabled")          or
           -moz-bool-pref("userChrome.LightTheme.TabFrameType.Shadow.Enabled")
          )
and
          (
           -moz-bool-pref("userChrome.LightTheme.TabFrameColor.Auto.Enabled")           or
           -moz-bool-pref("userChrome.LightTheme.TabFrameColor.White.Enabled")          or
           -moz-bool-pref("userChrome.LightTheme.TabFrameColor.Black.Enabled")
          )
and
          (
           -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.Low.Enabled")       or
           -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.Medium.Enabled")    or
           -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.High.Enabled")      or
           -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.VeryHigh.Enabled")
          )
          )
{
    @media (prefers-color-scheme: light)
    {
        :root
        {
            --outer-box-shadow: 0
                                0
                                var(--shadow-blur)
                                color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent);

            --inner-box-shadow: inset
                                0
                                calc(-1 * var(--shadow-blur))
                                var(--shadow-blur)
                                calc(-1 * var(--shadow-blur))
                                color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent);

            --outer-drop-shadow: drop-shadow(
                                 0
                                 0
                                 calc(var(--shadow-blur) / 2)
                                 color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent));
        }

        /* ---------- Tab Frame Type ---------- */

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameType.Border.Enabled")
        {
            :root
            {
                --shadow-blur: 2px;
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameType.Shadow.Enabled")
        {
            :root
            {
                --shadow-blur: 4px;
            }
        }

        /* ---------- Tab Frame Color ---------- */

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameColor.Auto.Enabled")
        {
            :root
            {
                --shadow-color: var(--toolbar-color);
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameColor.White.Enabled")
        {
            :root
            {
                --shadow-color: rgb(255,255,255);
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameColor.Black.Enabled")
        {
            :root
            {
                --shadow-color: rgb(0,0,0);
            }
        }

        /* ---------- Tab Frame Saturation ---------- */

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.Low.Enabled")
        {
            :root
            {
                --shadow-saturation: 10%;
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.Medium.Enabled")
        {
            :root
            {
                --shadow-saturation: 25%;
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.High.Enabled")
        {
            :root
            {
                --shadow-saturation: 50%;
            }
        }

        @supports -moz-bool-pref("userChrome.LightTheme.TabFrameSaturation.VeryHigh.Enabled")
        {
            :root
            {
                --shadow-saturation: 100%;
            }
        }
    }
}

@supports (
          (
           -moz-bool-pref("userChrome.DarkTheme.TabFrameType.Border.Enabled")           or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameType.Shadow.Enabled")
          )
and
          (
           -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.Auto.Enabled")            or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.White.Enabled")           or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.Black.Enabled")
          )
and
          (
           -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.Low.Enabled")        or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.Medium.Enabled")     or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.High.Enabled")       or
           -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.VeryHigh.Enabled")
          )
          )
{
    @media (prefers-color-scheme: dark)
    {
        :root
        {
            --outer-box-shadow: 0
                                0
                                var(--shadow-blur)
                                color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent);

            --inner-box-shadow: inset
                                0
                                calc(-1 * var(--shadow-blur))
                                var(--shadow-blur)
                                calc(-1 * var(--shadow-blur))
                                color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent);

            --outer-drop-shadow: drop-shadow(
                                 0
                                 0
                                 calc(var(--shadow-blur) / 2)
                                 color-mix(in srgb, var(--shadow-color) var(--shadow-saturation), transparent));
        }

        /* ---------- Tab Frame Type ---------- */

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameType.Border.Enabled")
        {
            :root
            {
                --shadow-blur: 2px;
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameType.Shadow.Enabled")
        {
            :root
            {
                --shadow-blur: 4px;
            }
        }

        /* ---------- Tab Frame Color ---------- */

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.Auto.Enabled")
        {
            :root
            {
                --shadow-color: var(--toolbar-color);
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.White.Enabled")
        {
            :root
            {
                --shadow-color: rgb(255,255,255);
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameColor.Black.Enabled")
        {
            :root
            {
                --shadow-color: rgb(0,0,0);
            }
        }

        /* ---------- Tab Frame Saturation ---------- */

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.Low.Enabled")
        {
            :root
            {
                --shadow-saturation: 25%;
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.Medium.Enabled")
        {
            :root
            {
                --shadow-saturation: 50%;
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.High.Enabled")
        {
            :root
            {
                --shadow-saturation: 75%;
            }
        }

        @supports -moz-bool-pref("userChrome.DarkTheme.TabFrameSaturation.VeryHigh.Enabled")
        {
            :root
            {
                --shadow-saturation: 100%;
            }
        }
    }
}

/* ---------------------------------------- Pinned Tabs Width ---------------------------------------- */

@supports -moz-bool-pref("userChrome.PinnedTabsWidthLowIncrease-Enabled")
{
    :root
    {
        --pinned-tabs-width-offset: 2px;
    }
}

@supports -moz-bool-pref("userChrome.PinnedTabsWidthHighIncrease-Enabled")
{
    :root
    {
        --pinned-tabs-width-offset: 4px;
    }
}

/* ---------------------------------------- Firefox View ---------------------------------------- */

:where(toolbarbutton, toolbarpaletteitem) + #tabbrowser-tabs
{
    border-inline-start: none !important;
    padding-inline-start: var(--tab-overflow-pinned-tabs-width) !important;
    margin-inline-start: 0px !important;
}

#TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon
{
    background-color: var(--toolbarbutton-active-background) !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
}

#TabsToolbar #firefox-view-button:hover:not([open]) > .toolbarbutton-icon
{
    background-color: var(--toolbarbutton-hover-background) !important;
}

#TabsToolbar #firefox-view-button[attention]
{
    --tab-attention-icon-color: currentColor !important;
    background-position: var(--tab-attention-indicator-position) !important;
}

/* ---------------------------------------- Main Window ---------------------------------------- */

:root
{
    --tab-shadow-max-size: 0px !important;
    --tabs-navbar-shadow-size: 0px !important;
    --button-hover-bgcolor: color-mix(in srgb, currentColor 10%, transparent) !important;
    --button-active-bgcolor: color-mix(in srgb, currentColor 20%, transparent) !important;
    --toolbarbutton-hover-background: var(--button-hover-bgcolor) !important;
    /* --toolbarbutton-active-background: var(--button-active-bgcolor) !important; */
}

/* ---------------------------------------- Density ---------------------------------------- */

:root[uidensity="compact"]
{
    --tab-min-height: 32px !important;
}

:root[uidensity="touch"]
{
    --tab-min-height: 40px !important;
}

/* ---------------------------------------- Context Menus (Not System Related) ---------------------------------------- */

@supports -moz-bool-pref("userChrome.CompactContextMenu-Enabled") or
          -moz-bool-pref("userChrome.NormalContextMenu-Enabled") or
          -moz-bool-pref("userChrome.TouchContextMenu-Enabled")
{
    :root
    {
        --arrowpanel-menuitem-margin-block:   0px !important;
        --arrowpanel-menuitem-margin-inline:  var(--browser-context-menu-margin-padding) !important;
        --arrowpanel-menuitem-padding-block:  var(--browser-context-menu-margin-padding) !important;
        --arrowpanel-menuitem-padding-inline: var(--browser-context-menu-margin-padding) !important;
        --panel-separator-margin-horizontal:  var(--browser-context-menu-margin-padding) !important;
        --panel-separator-margin-vertical:    var(--browser-context-menu-margin-padding) !important;
        --panel-subview-body-padding-block:   var(--browser-context-menu-margin-padding) !important;
        --panel-subview-body-padding-inline:  0px !important;
    }
}

@supports -moz-bool-pref("userChrome.CompactContextMenu-Enabled")
{
    :root
    {
        --browser-context-menu-margin-padding: 4px;
    }
}

@supports -moz-bool-pref("userChrome.NormalContextMenu-Enabled")
{
    :root
    {
        --browser-context-menu-margin-padding: 6px;
    }
}

@supports -moz-bool-pref("userChrome.TouchContextMenu-Enabled")
{
    :root
    {
        --browser-context-menu-margin-padding: 8px;
    }
}

/* -------------------- Extensions menu -------------------- */

#unified-extensions-panel
{
    --uei-icon-size: 24px !important;
}

#unified-extensions-panel .unified-extensions-item
{
    margin-block: 0px !important;
}

#unified-extensions-panel :is(
                              .unified-extensions-item-name,
                              .unified-extensions-item-message-deck > *
                             )
{
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

/* ---------------------------------------- Drag Space ---------------------------------------- */

@supports -moz-bool-pref("userChrome.DragSpace.Left.Disabled")
{
    .titlebar-spacer[type="pre-tabs"]
    {
        display: none !important;
    }
}

@supports -moz-bool-pref("userChrome.DragSpace.Right.Disabled")
{
    .titlebar-spacer[type="post-tabs"]
    {
        display: none !important;
    }
}

@supports -moz-bool-pref("userChrome.DragSpace.Top.Windowed.Enabled")
{
    :root[sizemode="normal"]
    {
        --drag-space: 8px;
    }
}

@supports -moz-bool-pref("userChrome.DragSpace.Top.Maximized.Enabled")
{
    :root[sizemode="maximized"]
    {
        --drag-space: 8px;
    }
}

@supports -moz-bool-pref("userChrome.DragSpace.Top.Fullscreen.Enabled")
{
    :root[sizemode="fullscreen"]
    {
        --drag-space: 8px;
    }
}

#TabsToolbar :is(.tabbrowser-tab, .toolbarbutton-1, separator, #personal-bookmarks, #search-container, .accessibility-indicator, .private-browsing-indicator, #private-browsing-indicator-with-label)
{
    margin-top: var(--drag-space, 0px) !important;
}

/* ---------- Shadow DOM ---------- */

#tabbrowser-arrowscrollbox
{
    --margin-top: var(--drag-space, 0px) !important;
}

#scrollbutton-up,
#scrollbutton-down,
spacer[part="overflow-start-indicator"],
spacer[part="overflow-end-indicator"]
{
    margin-top: var(--margin-top, revert) !important;
}

/* ---------------------------------------- Titlebar ---------------------------------------- */

.titlebar-color
{
    color: inherit !important;
    --toolbarbutton-icon-fill: currentColor !important;
}

/* ---------------------------------------- Tabs ---------------------------------------- */

.tabbrowser-tab
{
    --tab-loading-fill: currentColor !important;
    --tab-attention-icon-color: currentColor !important;
    --tab-label-mask-size: 0px !important;
    color: inherit !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overflow-clip-margin: var(--tab-overflow-clip-margin) !important;
    clip-path: inset(var(--tab-inset-clip-path)) !important;
    padding-inline: var(--tab-inline-padding) !important;
}

.tabbrowser-tab[visuallyselected]
{
    --tab-loading-fill: var(--toolbar-field-focus-border-color) !important;
    color: var(--toolbar-color) !important;
    position: relative;
    z-index: 2;
    filter: var(--outer-drop-shadow, none);
}

.tab-background
{
    --gradient-background-image: linear-gradient(var(--toolbar-bgcolor), var(--toolbar-bgcolor));
    --gradient-background-attachment: scroll;
    --gradient-background-size: auto 100%;
    --gradient-background-position: 0 0;
    --gradient-background-repeat: repeat-x;

    --amo-background-image-1: var(--lwt-header-image, none);
    --amo-background-attachment-1: fixed;
    --amo-background-size-1: auto auto;
    --amo-background-position-1: right top;
    --amo-background-repeat-1: no-repeat;

    --amo-background-image-2: var(--lwt-additional-images, none);
    --amo-background-attachment-2: fixed, fixed, fixed;
    --amo-background-size-2: auto auto, auto auto, auto auto;
    --amo-background-position-2: var(--lwt-background-alignment);
    --amo-background-repeat-2: var(--lwt-background-tiling);

    --svg-mask-image: var(--left-svg), var(--center-svg), var(--right-svg);
    --svg-mask-origin: border-box;
    --svg-mask-size: auto 100%, calc(100% - var(--tab-min-height) * 2) 100%, auto 100%;
    --svg-mask-position: left center, center center, right center;
    --svg-mask-repeat: no-repeat, no-repeat, no-repeat;

    mask-image: var(--svg-mask-image);
    mask-origin: var(--svg-mask-origin);
    mask-size: var(--svg-mask-size);
    mask-position: var(--svg-mask-position);
    mask-repeat: var(--svg-mask-repeat);

    box-shadow: none !important;
    opacity: 1 !important;
    border: none !important;
    outline: none !important;
    margin-block: var(--tab-bg-block-margin) !important;
    margin-inline: calc(-1 * (var(--tab-min-height) / 2)) !important;
    border-radius: 0px !important;
    pointer-events: none !important;
}

.tabbrowser-tab[visuallyselected] .tab-background
{
    background-image: var(--gradient-background-image), var(--amo-background-image-1), var(--amo-background-image-2) !important;
    background-attachment: var(--gradient-background-attachment), var(--amo-background-attachment-1), var(--amo-background-attachment-2) !important;
    background-size: var(--gradient-background-size), var(--amo-background-size-1), var(--amo-background-size-2) !important;
    background-position: var(--gradient-background-position), var(--amo-background-position-1), var(--amo-background-position-2) !important;
    background-repeat: var(--gradient-background-repeat), var(--amo-background-repeat-1), var(--amo-background-repeat-2) !important;
    background-color: transparent !important;
}

.tabbrowser-tab:not([visuallyselected]) .tab-background
{
    background-image: none !important;
}

#tabbrowser-tabs[movingtab] .tabbrowser-tab:is([visuallyselected], [multiselected])
{
    color: rgb(0,0,0) !important;
}

#tabbrowser-tabs[movingtab] .tabbrowser-tab:is([visuallyselected], [multiselected]) .tab-background
{
    --toolbar-bgcolor: var(--warning-icon-bgcolor);
    background-color: var(--warning-icon-bgcolor) !important;
}

#tabbrowser-tabs[movingtab] .tabbrowser-tab:not([visuallyselected])
{
    z-index: auto !important;
}

.tabbrowser-tab:hover:not([visuallyselected], [multiselected]) .tab-background
{
    background-color: var(--toolbarbutton-hover-background) !important;
}

.tabbrowser-tab[multiselected]:not([visuallyselected]) .tab-background
{
    background-color: var(--toolbarbutton-active-background) !important;
}

.tab-close-button
{
    width: 16px !important;
    height: 16px !important;
    padding: 2px !important;
    margin: 0px !important;
}

.tab-content
{
    padding-inline: calc((var(--tab-min-height) - 16px) / 2 + var(--pinned-tabs-width-offset, 0px)) !important;
}

.tabbrowser-tab[pending] .tab-content
{
    opacity: 0.5 !important;
}

/* -------------------- Selected Tab Indicator -------------------- */

@supports -moz-bool-pref("userChrome.Tabs.SelectedTabIndicator.Enabled")
{
    .tabbrowser-tab[visuallyselected][usercontextid] .tab-background
    {
        box-shadow: inset 0 -2px 0 var(--tab-loading-fill) !important;
    }

    .tabbrowser-tab[visuallyselected]:not([usercontextid]) .tab-background
    {
        box-shadow: inset 0 2px 0 var(--tab-loading-fill) !important;
    }
}

/* -------------------- Tab Counter -------------------- */

#tabbrowser-tabs
{
    counter-reset: TabCounter;
}

.tabbrowser-tab
{
    counter-increment: TabCounter;
}

#tabbrowser-tabs ~ #alltabs-button::after
{
    content: counter(TabCounter);
}

/* -------------------- Container Indicators -------------------- */

.tab-context-line
{
    margin: 0px !important;
}

/* -------------------- Tab Icon Indicators -------------------- */

.tabbrowser-tab:not([visuallyselected]) .tab-icon-stack[busy] .tab-throbber::before
{
    fill: currentColor !important;
}

.tabbrowser-tab:is([image], [pinned]) .tab-content[attention]:not([selected]),
.tab-content[pinned][titlechanged]:not([selected])
{
    background-position: var(--tab-attention-indicator-position) !important;
}

/* -------------------- Media Icons -------------------- */

.tab-icon-overlay:not([crashed])
{
    stroke: transparent !important;
    background-color: transparent !important;
    border-radius: 50% !important;
    color: inherit !important;
    fill: currentColor !important;
    fill-opacity: 1 !important;
    z-index: 1 !important;
}

.tab-icon-overlay:not([crashed]):hover
{
    background-color: var(--toolbarbutton-hover-background) !important;
}

.tab-icon-overlay:not([crashed]):hover:active
{
    background-color: var(--toolbarbutton-active-background) !important;
}

.tabbrowser-tab:is([pinned], [image], [sharing], [pictureinpicture]):not([crashed]) .tab-icon-overlay
{
    top: -8px !important;
    inset-inline-end: -8px !important;
}

.tab-icon-overlay[indicator-replaces-favicon],
.tab-icon-stack[indicator-replaces-favicon] > :not(.tab-icon-overlay)
{
    opacity: 1 !important;
}

.tabbrowser-tab:not([pinned]) .tab-icon-stack > *
{
    margin-inline-end: 10px !important;
}

.tabbrowser-tab[busy] .tab-icon-overlay
{
    display: none !important;
}

.tabbrowser-tab:is([pinned], [image], [sharing], [pictureinpicture]):is([soundplaying], [muted], [activemedia-blocked]):not([busy], [crashed]) .tab-icon-stack > :not(.tab-icon-overlay)
{
    mask-image: url("special/Additional_Elements/Media.svg");
    mask-size: 16px 16px;
}

:root:-moz-locale-dir(rtl) .tabbrowser-tab:is([pinned], [image], [sharing], [pictureinpicture]):is([soundplaying], [muted], [activemedia-blocked]):not([busy], [crashed]) .tab-icon-stack > :not(.tab-icon-overlay)
{
    mask-image: url("special/Additional_Elements/Media_rtl.svg");
}

/* ---------- Picture-In-Picture ---------- */

.tabbrowser-tab[pictureinpicture]:not([busy], [crashed]) .tab-icon-stack::before
{
    content: "";
    display: block;
    position: absolute;
    width: 16px;
    height: 16px;
    background-image: url("chrome://global/skin/media/picture-in-picture-open.svg");
    background-size: 16px;
    background-position: center center;
    background-repeat: no-repeat;
    fill: currentColor;
    -moz-context-properties: fill;
}

:root:-moz-locale-dir(rtl) .tabbrowser-tab[pictureinpicture]:not([busy], [crashed]) .tab-icon-stack::before
{
    transform: rotateY(180deg);
}

.tabbrowser-tab[pictureinpicture]:not([busy], [crashed]) .tab-icon-stack > :not(.tab-icon-overlay)
{
    position: relative !important;
    padding: 2px !important;
    inset-inline-start: 8px !important;
    top: 8px !important;
    mask-image: none !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
}

.tabbrowser-tab[pictureinpicture]:not([busy], [crashed]):not([soundplaying], [muted], [activemedia-blocked]) .tab-icon-stack::before
{
    mask-image: url("special/Additional_Elements/PIP.svg");
    mask-size: 100% 100%;
}

.tabbrowser-tab[pictureinpicture]:not([busy], [crashed]):is([soundplaying], [muted], [activemedia-blocked]) .tab-icon-stack::before
{
    mask-image: url("special/Additional_Elements/PIP_Sound.svg");
    mask-size: 100% 100%;
}

/* -------------------- Tab Text -------------------- */

.tab-label-container
{
    height: var(--tab-min-height) !important;
    font-size: 12px !important;
}

.tab-label
{
    width: 100% !important;
    height: 16px !important;
    line-height: 16px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-block: 0px !important;
}

#tabbrowser-tabs[secondarytext-unsupported] .tab-label
{
    height: var(--tab-min-height) !important;
    line-height: var(--tab-min-height) !important;
}

.tab-secondary-label
{
    width: 100% !important;
    height: 16px !important;
    line-height: 16px !important;
    margin-block: 0px !important;
    order: -1 !important;
}

.tab-secondary-label > *
{
    width: 100% !important;
    height: 16px !important;
    line-height: 16px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ---------------------------------------- Tab Bar ---------------------------------------- */

#TabsToolbar
{
    --toolbarbutton-inner-padding: inherit !important;
    position: relative !important;
}

#TabsToolbar::before
{
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0px;
    inset-inline-start: 0px;
    box-shadow: var(--inner-box-shadow, none);
    pointer-events: none;
    z-index: 2;
}

#TabsToolbar #search-container
{
    padding-block: 0 !important;
}

/* ---------------------------------------- Indents ---------------------------------------- */

#TabsToolbar-customization-target > :is(toolbarbutton, toolbaritem):first-child,
#TabsToolbar-customization-target > toolbarpaletteitem:first-child > :is(toolbarbutton, toolbaritem)
{
    margin-inline-start: calc(var(--toolbar-start-end-padding) - var(--toolbarbutton-outer-padding)) !important;
}

#TabsToolbar-customization-target > :is(toolbarbutton, toolbaritem):last-child,
#TabsToolbar-customization-target > toolbarpaletteitem:last-child > :is(toolbarbutton, toolbaritem)
{
    margin-inline-end: calc(var(--toolbar-start-end-padding) - var(--toolbarbutton-outer-padding)) !important;
}

#tabbrowser-tabs:not([overflow]) .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden]))
{
    margin-inline-start: 0px !important;
}

#tabbrowser-tabs:not([overflow]) .tabbrowser-tab:nth-child(1 of :not([hidden])),
#tabbrowser-tabs[overflow] .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])),
#tabbrowser-tabs[overflow][haspinnedtabs]
{
    margin-inline-start: var(--tab-first-last-inline-margin) !important;
}

.tabbrowser-tab:not([hidden]):last-of-type,
.tabbrowser-tab:not([hidden]):has(+ .tabbrowser-tab[hidden]:last-of-type),
.tabbrowser-tab:not([hidden]):has(+ .tabbrowser-tab[hidden] ~ .tabbrowser-tab[hidden]:last-of-type)
{
    margin-inline-end: var(--tab-first-last-inline-margin) !important;
}

/* ---------------------------------------- Separators ---------------------------------------- */

@supports -moz-bool-pref("userChrome.TabSeparatorsLowSaturation-Enabled")    or
          -moz-bool-pref("userChrome.TabSeparatorsMediumSaturation-Enabled")
{
    .tab-stack
    {
        margin-inline-start: 1px !important;
    }

    #tabbrowser-tabs:not([movingtab]) .tab-stack::before
    {
        content: "";
        display: block;
        position: absolute;
        width: 1px;
        height: 50%;
        border-inline-start: 1px solid currentColor;
        top: 25%;
        opacity: var(--separators-color-saturation);
        box-sizing: border-box;
        pointer-events: none;
    }

    .tab-stack::before
    {
        inset-inline-end: 100%;
        transform: translateX(calc(-1 * var(--tab-separator-offset)));
    }

    .tabbrowser-tab:not([hidden]):is(
                                     [selected],
                                     [selected] + .tabbrowser-tab:not([hidden]),
                                     [selected] + .tabbrowser-tab[hidden] ~ .tabbrowser-tab:not([hidden]),
                                     :hover,
                                     :hover + .tabbrowser-tab:not([hidden]),
                                     :hover + .tabbrowser-tab[hidden] ~ .tabbrowser-tab:not([hidden]),
                                     [multiselected],
                                     [multiselected] + .tabbrowser-tab:not([hidden]),
                                     [multiselected] + .tabbrowser-tab[hidden] ~ .tabbrowser-tab:not([hidden])
                                    ) .tab-stack::before
    {
        opacity: 0 !important;
    }

    .tabbrowser-tab:not([hidden]):first-of-type .tab-stack::before,
    .tabbrowser-tab[hidden]:first-of-type + .tabbrowser-tab:not([hidden]) .tab-stack::before,
    .tabbrowser-tab[hidden]:first-of-type + .tabbrowser-tab[hidden] ~ .tabbrowser-tab:not([hidden]) .tab-stack::before
    {
        opacity: 0 !important;
    }

    #tabbrowser-tabs[overflow] .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) .tab-stack::before
    {
        opacity: 0 !important;
    }

    @supports -moz-bool-pref("userChrome.TabSeparatorsLowSaturation-Enabled")
    {
        :root
        {
            --separators-color-saturation: 0.25;
        }
    }

    @supports -moz-bool-pref("userChrome.TabSeparatorsMediumSaturation-Enabled")
    {
        :root
        {
            --separators-color-saturation: 0.5;
        }
    }
}

/*

.tab-stack
{
    margin-right: 1px !important;
}

.tabbrowser-tab:is(
                   :not([hidden]):first-of-type,
                   [hidden]:first-of-type + .tabbrowser-tab:not([hidden]),
                   [hidden]:first-of-type ~ .tabbrowser-tab[hidden] + .tabbrowser-tab:not([hidden])
                  ) .tab-stack::before,
#tabbrowser-tabs[overflow] .tabbrowser-tab[first-visible-unpinned-tab] .tab-stack::before,
.tab-stack::after
{
    content: "";
    display: block;
    position: absolute;
    width: 1px;
    height: 50%;
    border-left: 1px solid currentColor;
    top: 25%;
    opacity: var(--separators-color-saturation, 0);
    box-sizing: border-box;
    pointer-events: none;
}

.tab-stack::before
{
    right: 100%;
    transform: translateX(calc(-1 * var(--tab-separator-offset)));
}

.tab-stack::after
{
    left: 100%;
    transform: translateX(var(--tab-separator-offset));
}

#tabbrowser-tabs:is([movingtab], :first-child) .tab-stack::before,
#tabbrowser-tabs[movingtab] .tab-stack::after
{
    opacity: 0;
}

.tabbrowser-tab:not([hidden]):is(
                                 [selected], :hover, [multiselected], [usercontextid]
                                ) .tab-stack::before,
.tabbrowser-tab:not([hidden]):is(
                                 [selected], :hover, [multiselected], [usercontextid],
                                 :has(+ .tabbrowser-tab:not([hidden]):is([selected], :hover, [multiselected], [usercontextid])),
                                 :has(+ .tabbrowser-tab[hidden] ~ .tabbrowser-tab:not([hidden]):is([selected], :hover, [multiselected], [usercontextid]))
                                ) .tab-stack::after
{
    opacity: 0 !important;
}

*/

/* ---------------------------------------- Tab Scroll Animation ---------------------------------------- */

#tabbrowser-tabs[overflow] .tabbrowser-tab:not([pinned])
{
    box-sizing: content-box !important;
}

#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:not([pinned])
{
    pointer-events: none !important;
    box-sizing: content-box !important;
    padding-inline: var(--tab-scroll-animation-inline-padding) !important;
    margin-inline: var(--tab-scroll-animation-inline-margin) !important;
    overflow-clip-margin: 0px !important;
}

#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:not([pinned]) .tab-stack
{
    pointer-events: auto !important;
}

#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden]))
{
    margin-inline-start: 0px !important;
}

#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:not([hidden]):last-of-type,
#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:not([hidden]):has(+ .tabbrowser-tab[hidden]:last-of-type),
#tabbrowser-tabs[overflow]:not([movingtab]) .tabbrowser-tab:not([hidden]):has(+ .tabbrowser-tab[hidden] ~ .tabbrowser-tab[hidden]:last-of-type)
{
    margin-inline-end: 0px !important;
}

/* ---------------------------------------- Rounded Elements ---------------------------------------- */

@supports -moz-bool-pref("userChrome.Tabs.Option5.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option8.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option9.Enabled")  or
          -moz-bool-pref("userChrome.Tabs.Option11.Enabled") or
          -moz-bool-pref("userChrome.Tabs.Option12.Enabled")
{
    #TabsToolbar :is(#tabs-newtab-button > .toolbarbutton-icon,
                     #new-tab-button > .toolbarbutton-icon,
                     #firefox-view-button > .toolbarbutton-icon,
                     #alltabs-button > .toolbarbutton-badge-stack,
                     .tab-close-button)
    {
        border-radius: 50% !important;
    }

    :root
    {
        --urlbar-icon-border-radius: 50px !important;
    }

    #urlbar:not([open]) #urlbar-background, #searchbar
    {
        border-radius: 50px !important;
    }
}

/* ---------------------------------------- Menu Icons ---------------------------------------- */

/* ---------- Regular Icons ---------- */

/* @supports -moz-bool-pref("userChrome.RegularMenuIcons-Enabled")
{
    :root
    {
        --tab-new-page: url("./icons/tab_desktop_new_page_20_regular.svg");
        --window: url("./icons/window_20_regular.svg");
        --window-inprivate-account: url("./icons/window_inprivate_account_20_regular.svg");
        --star-line-horizontal: url("./icons/star_line_horizontal_3_20_regular.svg");
        --star-add: url("./icons/star_add_20_regular.svg");
        --star: url("./icons/star_20_filled.svg");
        --history: url("./icons/history_20_regular.svg");
        --arrow-download: url("./icons/arrow_download_20_regular.svg");
        --key: url("./icons/key_20_regular.svg");
        --puzzle-piece: url("./icons/puzzle_piece_20_regular.svg");
        --print: url("./icons/print_20_regular.svg");
        --save-edit: url("./icons/save_edit_20_regular.svg");
        --document-search: url("./icons/document_search_20_regular.svg");
        --settings: url("./icons/settings_20_regular.svg");
        --question-circle: url("./icons/question_circle_20_regular.svg");
        --color: url("./icons/color_20_regular.svg");
        --window-dev-tools: url("./icons/window_dev_tools_20_regular.svg");
        --person-feedback: url("./icons/person_feedback_20_regular.svg");
        --warning: url("./icons/warning_20_regular.svg");
        --arrow-clockwise: url("./icons/arrow_clockwise_20_regular.svg");
        --arrow-redo: url("./icons/arrow_redo_20_regular.svg");
        --arrow-undo: url("./icons/arrow_undo_20_regular.svg");
        --clipboard-paste: url("./icons/clipboard_paste_20_regular.svg");
        --clipboard-search: url("./icons/clipboard_search_20_regular.svg");
        --copy: url("./icons/copy_20_regular.svg");
        --cut: url("./icons/cut_20_regular.svg");
        --delete: url("./icons/delete_20_regular.svg");
        --dismiss: url("./icons/dismiss_20_regular.svg");
        --folder-add: url("./icons/folder_add_20_regular.svg");
        --pin: url("./icons/pin_20_regular.svg");
        --speaker-mute: url("./icons/speaker_mute_20_regular.svg");
        --tab-desktop: url("./icons/tab_desktop_20_regular.svg");
        --tab-desktop-copy: url("./icons/tab_desktop_copy_20_regular.svg");
        --edit: url("./icons/edit_20_regular.svg");
        --speaker-2: url("./icons/speaker_2_20_regular.svg");
        --camera-edit: url("./icons/camera_edit_20_regular.svg");
        --cursor-hover: url("./icons/cursor_hover_20_regular.svg");
        --image-copy: url("./icons/image_copy_20_regular.svg");
        --image-edit: url("./icons/image_edit_20_regular.svg");
        --link: url("./icons/link_20_regular.svg");
        --play: url("./icons/play_20_regular.svg");
        --pause: url("./icons/pause_20_regular.svg");
        --search: url("./icons/search_20_regular.svg");
        --tab-desktop-image: url("./icons/tab_desktop_image_20_regular.svg");
        --translate: url("./icons/translate_20_regular.svg");
    }
} */

/* ---------- Filled Icons ---------- */

/* @supports -moz-bool-pref("userChrome.FilledMenuIcons-Enabled")
{
    :root
    {
        --tab-new-page: url("./icons/tab_desktop_new_page_20_filled.svg");
        --window: url("./icons/window_20_filled.svg");
        --window-inprivate-account: url("./icons/window_inprivate_account_20_filled.svg");
        --star-line-horizontal: url("./icons/star_line_horizontal_3_20_filled.svg");
        --star-add: url("./icons/star_add_20_filled.svg");
        --star: url("./icons/star_20_filled.svg");
        --history: url("./icons/history_20_filled.svg");
        --arrow-download: url("./icons/arrow_download_20_filled.svg");
        --key: url("./icons/key_20_filled.svg");
        --puzzle-piece: url("./icons/puzzle_piece_20_filled.svg");
        --print: url("./icons/print_20_filled.svg");
        --save-edit: url("./icons/save_edit_20_filled.svg");
        --document-search: url("./icons/document_search_20_filled.svg");
        --settings: url("./icons/settings_20_filled.svg");
        --question-circle: url("./icons/question_circle_20_filled.svg");
        --color: url("./icons/color_20_filled.svg");
        --window-dev-tools: url("./icons/window_dev_tools_20_filled.svg");
        --person-feedback: url("./icons/person_feedback_20_filled.svg");
        --warning: url("./icons/warning_20_filled.svg");
        --arrow-clockwise: url("./icons/arrow_clockwise_20_filled.svg");
        --arrow-redo: url("./icons/arrow_redo_20_filled.svg");
        --arrow-undo: url("./icons/arrow_undo_20_filled.svg");
        --clipboard-paste: url("./icons/clipboard_paste_20_filled.svg");
        --clipboard-search: url("./icons/clipboard_search_20_filled.svg");
        --copy: url("./icons/copy_20_filled.svg");
        --cut: url("./icons/cut_20_filled.svg");
        --delete: url("./icons/delete_20_filled.svg");
        --dismiss: url("./icons/dismiss_20_filled.svg");
        --folder-add: url("./icons/folder_add_20_filled.svg");
        --pin: url("./icons/pin_20_filled.svg");
        --speaker-mute: url("./icons/speaker_mute_20_filled.svg");
        --tab-desktop: url("./icons/tab_desktop_20_filled.svg");
        --tab-desktop-copy: url("./icons/tab_desktop_copy_20_filled.svg");
        --edit: url("./icons/edit_20_filled.svg");
        --speaker-2: url("./icons/speaker_2_20_filled.svg");
        --camera-edit: url("./icons/camera_edit_20_filled.svg");
        --cursor-hover: url("./icons/cursor_hover_20_filled.svg");
        --image-copy: url("./icons/image_copy_20_filled.svg");
        --image-edit: url("./icons/image_edit_20_filled.svg");
        --link: url("./icons/link_20_filled.svg");
        --play: url("./icons/play_20_filled.svg");
        --pause: url("./icons/pause_20_filled.svg");
        --search: url("./icons/search_20_filled.svg");
        --tab-desktop-image: url("./icons/tab_desktop_image_20_filled.svg");
        --translate: url("./icons/translate_20_filled.svg");
    }
} */

/* ---------- Native Browser Menus ---------- */

@supports -moz-bool-pref("userChrome.RegularMenuIcons-Enabled") or
          -moz-bool-pref("userChrome.FilledMenuIcons-Enabled")
{
    :is(

        /* ----- Main Menu ----- */

        #appMenu-new-tab-button2,
        #appMenu-new-window-button2,
        #appMenu-new-private-window-button2,
        #appMenu-bookmarks-button,
        #appMenu-history-button,
        #appMenu-downloads-button,
        #appMenu-passwords-button,
        #appMenu-extensions-themes-button,
        #appMenu-print-button2,
        #appMenu-save-file-button2,
        #appMenu-find-button2,
        #appMenu-translate-button,
        #appMenu-settings-button,
        #appMenu-help-button2,

        /* ----- Main Menu (Submenus) ----- */

        #appmenu-moreTools-button,
        #appmenu-developer-tools-view > toolbarbutton:nth-child(1),

        #appMenu_menu_openHelp,
        #appMenu_feedbackPage,
        #appMenu_menu_HelpPopup_reportPhishingtoolmenu,

        /* ----- Bookmark Menu ----- */

        #panelMenuBookmarkThisPage,
        #panelMenu_showAllBookmarks,
        #BMB_bookmarksShowAllTop,
        #BMB_bookmarksShowAll,

        /* ----- History Menu ----- */

        #PanelUI-historyMore,

        /* ----- Library Menu ----- */

        #appMenu-library-bookmarks-button,
        #appMenu-library-history-button,
        #appMenu-library-downloads-button,

        /* ----- Downloads Menu ----- */

        #downloadsHistory,

        /* ----- Developer Menu ----- */

        #PanelUI-developer-tools-view > toolbarbutton:nth-child(1),

        /* ----- Sidebar Menu ----- */

        #sidebar-switcher-bookmarks,
        #sidebar-switcher-history

    )::before
    {
        content: "";
        display: block;
        position: relative;
        width: 20px;
        height: 20px;
        background-size: 20px;
        background-repeat: no-repeat;
        background-position: center;
        margin-block: -2px;
        margin-inline: -2px 6px;
        fill: currentColor;
        -moz-context-properties: fill;
    }

    /* ----- Main Menu ----- */

    #appMenu-new-tab-button2::before
    {
        background-image: var(--tab-new-page);
    }

    #appMenu-new-window-button2::before
    {
        background-image: var(--window);
    }

    #appMenu-new-private-window-button2::before
    {
        background-image: var(--window-inprivate-account);
    }

    #appMenu-bookmarks-button::before
    {
        background-image: var(--star-line-horizontal);
    }

    #appMenu-history-button::before
    {
        background-image: var(--history);
    }

    #appMenu-downloads-button::before
    {
        background-image: var(--arrow-download);
    }

    #appMenu-passwords-button::before
    {
        background-image: var(--key);
    }

    #appMenu-extensions-themes-button::before
    {
        background-image: var(--puzzle-piece);
    }

    #appMenu-print-button2::before
    {
        background-image: var(--print);
    }

    #appMenu-save-file-button2::before
    {
        background-image: var(--save-edit);
    }

    #appMenu-find-button2::before
    {
        background-image: var(--document-search);
    }

    #appMenu-translate-button::before
    {
        background-image: var(--translate);
    }

    #appMenu-settings-button::before
    {
        background-image: var(--settings);
    }

    #appMenu-help-button2::before
    {
        background-image: var(--question-circle);
    }

    /* ----- Main Menu (Submenus) ----- */

    #appmenu-moreTools-button::before
    {
        background-image: var(--color);
    }

    #appmenu-developer-tools-view > toolbarbutton:nth-child(1)::before
    {
        background-image: var(--window-dev-tools);
    }

    #appMenu_menu_openHelp::before
    {
        background-image: var(--question-circle);
    }

    #appMenu_feedbackPage::before
    {
        background-image: var(--person-feedback);
    }

    #appMenu_menu_HelpPopup_reportPhishingtoolmenu::before
    {
        background-image: var(--warning);
    }

    /* ----- Bookmark Menu ----- */

    #panelMenuBookmarkThisPage::before
    {
        background-image: var(--star-add);
    }

    #panelMenuBookmarkThisPage[starred]::before
    {
        background-image: var(--star);
        fill: var(--toolbar-field-icon-fill-attention) !important;
    }

    :is(#panelMenu_showAllBookmarks, #BMB_bookmarksShowAllTop, #BMB_bookmarksShowAll)::before
    {
        background-image: var(--star-line-horizontal);
    }

    /* ----- History Menu ----- */

    #PanelUI-historyMore::before
    {
        background-image: var(--history);
    }

    /* ----- Library Menu ----- */

    #appMenu-library-bookmarks-button::before
    {
        background-image: var(--star-line-horizontal);
    }

    #appMenu-library-history-button::before
    {
        background-image: var(--history);
    }

    #appMenu-library-downloads-button::before
    {
        background-image: var(--arrow-download);
    }

    /* ----- Downloads Menu ----- */

    #downloadsHistory::before
    {
        background-image: var(--arrow-download);
    }

    /* ----- Developer Menu ----- */

    #PanelUI-developer-tools-view > toolbarbutton:nth-child(1)::before
    {
        background-image: var(--window-dev-tools);
    }

    /* ----- Sidebar Menu ----- */

    #sidebar-switcher-bookmarks::before
    {
        background-image: var(--star-line-horizontal);
    }

    #sidebar-switcher-history::before
    {
        background-image: var(--history);
    }

    /* ---------- Non-Native Browser Menus ---------- */

    @media (-moz-platform: windows),
           (-moz-platform: linux)
    {

    :is(

        /* ----- Toolbar Menubar Menu ----- */

        menuitem.viewCustomizeToolbar,

        /* ----- TabsToolbar Menu ----- */

        #toolbar-context-openANewTab,
        #toolbar-context-reloadSelectedTab,
        #toolbar-context-bookmarkSelectedTab,

        /* ----- Tab Menu ----- */

        #context_openANewTab,
        #context_reloadTab,
        #context_toggleMuteTab,
        #context_pinTab,
        #context_unpinTab,
        #context_duplicateTab,
        #context_bookmarkTab,
        #context_openTabInWindow,
        #context_closeTab,

        /* ----- Tabs Menu ----- */

        #context_reloadSelectedTabs,
        #context_toggleMuteSelectedTabs,
        #context_pinSelectedTabs,
        #context_unpinSelectedTabs,
        #context_duplicateTabs,
        #context_bookmarkSelectedTabs,

        /* ----- Urlbar Menu ----- */

        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(1),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(2),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(4),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(5),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(7),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(8),
        menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(9),

        /* ----- Searchbar Menu ----- */

        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(1),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(2),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(4),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(5),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(6),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(7),
        menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(8),

        /* ----- PersonalToolbar Menu ----- */

        #placesContext_openBookmarkContainer\:tabs,
        #placesContext_new\:bookmark,
        #placesContext_new\:folder,
        #placesContext_paste,
        #placesContext_showAllBookmarks,

        /* ----- Bookmarks Menu ----- */

        #placesContext_open\:newtab,
        #placesContext_open\:newwindow,
        #placesContext_open\:newprivatewindow,
        #placesContext_show_bookmark\:info,
        #placesContext_deleteBookmark,
        #placesContext_cut,
        #placesContext_copy,
        #placesContext_paste_group,

        /* ----- Folder Menu ----- */

        #placesContext_show_folder\:info,
        #placesContext_deleteFolder,

        /* ---------- Web Menu ---------- */

        /* ----- Menu ----- */

        #context-savepage,
        #context-take-screenshot,
        #context-inspect,

        /* ----- Text Menu ----- */

        #context-copy,
        #context-print-selection,
        #context-searchselect,

        /* ----- Image Menu ----- */

        #context-viewimage,
        #context-saveimage,
        #context-copyimage-contents,

        /* ----- Link Menu ----- */

        #context-openlinkintab,
        #context-openlink,
        #context-openlinkprivate,
        #context-bookmarklink,
        #context-savelink,
        #context-copylink,

        /* ----- Input Menu ----- */

        #context-undo,
        #context-redo,
        #context-cut,
        #context-copy,
        #context-paste,
        #context-delete,
        #context-keywordfield,

        /* ----- Video Menu ----- */

        #context-media-play,
        #context-media-pause,
        #context-media-mute,
        #context-media-unmute,
        #context-viewvideo,
        #context-savevideo

    )::before
    {
        content: "";
        display: block;
        position: relative;
        width: 20px;
        height: 20px;
        background-size: 20px;
        background-repeat: no-repeat;
        background-position: center;
        margin-block: -2px;
        margin-inline: var(--align-menu-icons);
        fill: currentColor;
        -moz-context-properties: fill;
    }

    /* ----- Toolbar Menubar Menu ----- */

    menuitem.viewCustomizeToolbar::before
    {
        background-image: var(--color);
    }

    /* ----- TabsToolbar Menu ----- */

    #toolbar-context-openANewTab::before
    {
        background-image: var(--tab-new-page);
    }

    #toolbar-context-reloadSelectedTab::before
    {
        background-image: var(--arrow-clockwise);
    }

    #toolbar-context-bookmarkSelectedTab::before
    {
        background-image: var(--star-add);
    }

    /* ----- Tab Menu ----- */

    #context_openANewTab::before
    {
        background-image: var(--tab-new-page);
    }

    #context_reloadTab::before
    {
        background-image: var(--arrow-clockwise);
    }

    #context_toggleMuteTab::before
    {
        background-image: var(--speaker-mute);
    }

    #context_toggleMuteTab[muted]::before
    {
        background-image: var(--speaker-2);
    }

    :is(#context_pinTab, #context_unpinTab)::before
    {
        background-image: var(--pin);
    }

    #context_duplicateTab::before
    {
        background-image: var(--tab-desktop-copy);
    }

    #context_bookmarkTab::before
    {
        background-image: var(--star-add);
    }

    #context_openTabInWindow::before
    {
        background-image: var(--window);
    }

    #context_closeTab::before
    {
        background-image: var(--dismiss);
    }

    /* ----- Tabs Menu ----- */

    #context_reloadSelectedTabs::before
    {
        background-image: var(--arrow-clockwise);
    }

    #context_toggleMuteSelectedTabs::before
    {
        background-image: var(--speaker-mute);
    }

    #context_toggleMuteSelectedTabs[muted]::before
    {
        background-image: var(--speaker-2);
    }

    :is(#context_pinSelectedTabs, #context_unpinSelectedTabs)::before
    {
        background-image: var(--pin);
    }

    #context_duplicateTabs::before
    {
        background-image: var(--tab-desktop-copy);
    }

    #context_bookmarkSelectedTabs::before
    {
        background-image: var(--star-add);
    }

    /* ----- Urlbar Menu ----- */

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(1)::before
    {
        background-image: var(--arrow-undo);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(2)::before
    {
        background-image: var(--arrow-redo);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(4)::before
    {
        background-image: var(--cut);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(5)::before
    {
        background-image: var(--copy);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(7)::before
    {
        background-image: var(--clipboard-paste);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(8)::before
    {
        background-image: var(--clipboard-search);
    }

    menupopup.textbox-contextmenu:nth-child(3) > menuitem:nth-child(9)::before
    {
        background-image: var(--delete);
    }

    /* ----- Searchbar Menu ----- */

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(1)::before
    {
        background-image: var(--arrow-undo);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(2)::before
    {
        background-image: var(--arrow-redo);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(4)::before
    {
        background-image: var(--cut);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(5)::before
    {
        background-image: var(--copy);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(6)::before
    {
        background-image: var(--clipboard-paste);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(7)::before
    {
        background-image: var(--clipboard-search);
    }

    menupopup.textbox-contextmenu:nth-child(4) > menuitem:nth-child(8)::before
    {
        background-image: var(--delete);
    }

    /* ----- PersonalToolbar Menu ----- */

    #placesContext_openBookmarkContainer\:tabs::before
    {
        background-image: var(--tab-desktop);
    }

    #placesContext_new\:bookmark::before
    {
        background-image: var(--star-add);
    }

    #placesContext_new\:folder::before
    {
        background-image: var(--folder-add);
    }

    #placesContext_paste::before
    {
        background-image: var(--clipboard-paste);
    }

    #placesContext_showAllBookmarks::before
    {
        background-image: var(--star-line-horizontal);
    }

    /* ----- Bookmarks Menu ----- */

    #placesContext_open\:newtab::before
    {
        background-image: var(--tab-new-page);
    }

    #placesContext_open\:newwindow::before
    {
        background-image: var(--window);
    }

    #placesContext_open\:newprivatewindow::before
    {
        background-image: var(--window-inprivate-account);
    }

    #placesContext_show_bookmark\:info::before
    {
        background-image: var(--edit);
    }

    #placesContext_deleteBookmark::before
    {
        background-image: var(--delete);
    }

    #placesContext_cut::before
    {
        background-image: var(--cut);
    }

    #placesContext_copy::before
    {
        background-image: var(--copy);
    }

    #placesContext_paste_group::before
    {
        background-image: var(--clipboard-paste);
    }

    /* ----- Folder Menu ----- */

    #placesContext_show_folder\:info::before
    {
        background-image: var(--edit);
    }

    #placesContext_deleteFolder::before
    {
        background-image: var(--delete);
    }

    /* ---------- Web Menu ---------- */

    #context-savepage::before
    {
        background-image: var(--save-edit);
    }

    #context-take-screenshot::before
    {
        background-image: var(--camera-edit);
    }

    #context-inspect::before
    {
        background-image: var(--cursor-hover);
    }

    #context-copy::before
    {
        background-image: var(--copy);
    }

    #context-print-selection::before
    {
        background-image: var(--print);
    }

    #context-searchselect::before
    {
        background-image: var(--search);
    }

    #context-viewimage::before
    {
        background-image: var(--tab-desktop-image);
    }

    #context-saveimage::before
    {
        background-image: var(--image-edit);
    }

    #context-copyimage-contents::before
    {
        background-image: var(--image-copy);
    }

    #context-openlinkintab::before
    {
        background-image: var(--tab-desktop);
    }

    #context-openlink::before
    {
        background-image: var(--window);
    }

    #context-openlinkprivate::before
    {
        background-image: var(--window-inprivate-account);
    }

    #context-bookmarklink::before
    {
        background-image: var(--star-add);
    }

    #context-savelink::before
    {
        background-image: var(--save-edit);
    }

    #context-copylink::before
    {
        background-image: var(--link);
    }

    #context-undo::before
    {
        background-image: var(--arrow-undo);
    }

    #context-redo::before
    {
        background-image: var(--arrow-redo);
    }

    #context-cut::before
    {
        background-image: var(--cut);
    }

    #context-copy::before
    {
        background-image: var(--copy);
    }

    #context-paste::before
    {
        background-image: var(--clipboard-paste);
    }

    #context-delete::before
    {
        background-image: var(--delete);
    }

    #context-keywordfield::before
    {
        background-image: var(--star-add);
    }

    #context-media-play::before
    {
        background-image: var(--play);
    }

    #context-media-pause::before
    {
        background-image: var(--pause);
    }

    #context-media-mute::before
    {
        background-image: var(--speaker-mute);
    }

    #context-media-unmute::before
    {
        background-image: var(--speaker-2);
    }

    #context-viewvideo::before
    {
        background-image: var(--tab-desktop);
    }

    #context-savevideo::before
    {
        background-image: var(--save-edit);
    }

  }

}

  #urlbar-background,
  #searchbar {
    border-radius: 18px !important;
  }
  #urlbar, #searchbar {
    padding: 0 10px !important;
  }

}
